<?php
/**
 * start
 */
require_once 'include/init.php';

/**
 * init request.
 */
$request = Nuo::getRequest();

/**
 * init response
 */
$response = Nuo::getResponse();

/**
 * init router
 */
$router = Nuo::getRouter();

/**
 * match router
 */
if (!$router -> match($request))
{
    $request -> setActionId('core@error:error404');
}

/**
 * dispatch main request.
 */
$response -> setContent($request -> dispatch());

/**
 * define some layout rendered.
 */
echo Nuo::getHelper('core@parser') -> renderPage('default', $request -> getActionId(), Nuo::getSiteId());

/**
 * end process
 */
Nuo::fireEvent('onRequestShutdown');
